package com.julian.delegatePattern.virtualProxy;

import javax.swing.*;
import java.awt.*;

public class ImageLoaded implements State {
    ImageProxyState imageProxyState;

    public ImageLoaded(ImageProxyState imageProxyState) {
        this.imageProxyState = imageProxyState;
    }

    @Override
    public void paintIcon(Component c, Graphics g, int x, int y) {
        imageProxyState.paintIconByImageIcon(c,g,x,y);
    }

    @Override
    public int getIconWidth() {
        return imageProxyState.getIconWidthByImageIcon();
    }

    @Override
    public int getIconHeight() {
        return imageProxyState.getIconHeightByImageIcon();
    }

    public void setImageIcon(ImageIcon imageIcon) {
        this.imageProxyState.setImageIcon(imageIcon);
    }
}
